package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.goods.GoodsCatBO;
import com.ymk.service.IGoodsCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * <p>
 * 商品分类 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-05-05
 */
@Service
public class GoodsCatService implements IGoodsCatService {

    @Override
    public GoodsCatBO get(Map param) {
    return this.daoRouter.queryForObject("GoodsCat.loadGoodsCat",param);
    }

    @Override
    public List<GoodsCatBO> list(Map param) {
        return this.daoRouter.query("GoodsCat.loadGoodsCat",param);
    }

    @Override
    public List<GoodsCatBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("GoodsCat.loadGoodsCatForPage",pagination);
    }

    @Override
    public void post(GoodsCatBO param) {
        this.daoRouter.insert("AGoodsCat.insertGoodsCat",param);
    }

    @Override
    public void update(GoodsCatBO param) {
        this.daoRouter.update("AGoodsCat.updateGoodsCat",param);
    }

    @Override
    public void del(GoodsCatBO param) {
        this.daoRouter.update("AGoodsCat.delGoodsCat",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
